home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2004 April / SGI IRIX 6.5 Applications 2004 April.iso / dist / mozilla.idb / var / netscape / mozilla / chrome / toolkit.jar.z / toolkit.jar / content / global / fontpackage.js < prev    next >
Text File  |  2003-11-11  |  3KB  |  85 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3. *
  4. * The contents of this file are subject to the Mozilla Public License
  5. * Version 1.1 (the "License"); you may not use this file except in
  6. * compliance with the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * The Original Code is mozilla.org code.
  15. *
  16. * The Initial Developer of the Original Code is 
  17. * Netscape Communications Corporation.
  18. * Portions created by the Initial Developer are Copyright (C) 2003
  19. * the Initial Developer. All Rights Reserved.
  20. *
  21. * Contributor(s):
  22. *   Frank Yung-Fong Tang <ftang@netscape.com>
  23. *   Simon Montagu <smontagu@netscape.com>
  24. *   Seth Spitzer <sspitzer@netscape.com>
  25. *
  26. * Alternatively, the contents of this file may be used under the terms of
  27. * either the GNU General Public License Version 2 or later (the "GPL"), or 
  28. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29. * in which case the provisions of the GPL or the LGPL are applicable instead
  30. * of those above. If you wish to allow use of your version of this file only
  31. * under the terms of either the GPL or the LGPL, and not to allow others to
  32. * use your version of this file under the terms of the MPL, indicate your
  33. * decision by deleting the provisions above and replace them with the notice
  34. * and other provisions required by the GPL or the LGPL. If you do not delete
  35. * the provisions above, a recipient may use your version of this file under
  36. * the terms of any one of the MPL, the GPL or the LGPL.
  37. *
  38. * ***** END LICENSE BLOCK ***** */
  39.  
  40. var gLangCode;
  41.  
  42. function onLoad()
  43. {
  44.   var size = document.getElementById("size");
  45.   var downloadButton = document.getElementById("downloadButton");
  46.   var install = document.getElementById("install");
  47.   var fontPackageBundle = document.getElementById("fontPackageBundle");
  48.  
  49.   // test if win2k (win nt 5.0) or winxp (win nt 5.1)
  50.   if (navigator.userAgent.toLowerCase().indexOf("windows nt 5") != -1) 
  51.   {
  52.     downloadButton.setAttribute("hidden", "true");
  53.     size.setAttribute("hidden", "true");
  54.  
  55.     // if no download button
  56.     // set title to "Install Font"
  57.     // and set cancel button to "OK"
  58.     var downloadFontDialog = document.getElementById("downloadFontDialog");
  59.     downloadFontDialog.setAttribute("title", fontPackageBundle.getString("windowTitleNoDownload"));
  60.     var cancelButton = document.getElementById("cancelButton");
  61.     cancelButton.setAttribute("label", fontPackageBundle.getString("cancelButtonNoDownload"));
  62.   } 
  63.   else 
  64.   {
  65.     install.setAttribute("hidden", "true");
  66.   }
  67.  
  68.   // argument is a lang code of the form xx or xx-yy
  69.   gLangCode = window.arguments[0];
  70.  
  71.   var titleString = fontPackageBundle.getString("name_" + gLangCode);
  72.   var languageTitle = document.getElementById("languageTitle");
  73.   languageTitle.setAttribute("value", titleString);
  74.   
  75.   var sizeString = fontPackageBundle.getString("size_" + gLangCode);
  76.   var sizeSpecification = document.getElementById("sizeSpecification");
  77.   sizeSpecification.setAttribute("value", sizeString);
  78. }
  79.  
  80. function download()
  81.   window.open("http://www.mozilla.org/projects/intl/fonts/win/redirect/package_" + gLangCode + ".html");
  82. }
  83.  
  84.